﻿@{
    ViewBag.Title = "用户登录";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Content/layer-v3.1.1/layer/layer.js"></script>
@section Scripts{
    <script type="text/javascript">

        $(function () {
            //登录按钮的点击事件
            $("#btnSubmit").on("click", function () {
                var layerIndex = -1; //用来记录加载弹层index
                //表单提交
                $('#LoginForm').form('submit', {
                    url: '@Url.Content("~/Home/UserLoginByInfo")',
                    onSubmit: function () {
                        //return $(this).form('validate');
                        //表单字段验证
                        if ($(this).form('validate')) {
                            //add2019-09-09 plq 表单提交前，且表单字段验证无误后，显示加载中提示弹层，当提交成功后关闭
                            layerIndex = layer.msg('加载中', { icon: 16, shade: 0.01 }); //显示加载层
                            return true;
                        } else {
                            return false;
                        }
                    },
                    success: function (data) {
                        //console.log(data);
                        layer.close(layerIndex);//关闭加载层
                        var data = JSON.parse(data);//转为JSON对象
                        $.handleJsonResult(data, function () {
                            window.location = data.RedirectURL; //跳转到目标页
                        });

                    }
                });
            });

            //按下键盘上enter键触发登录按钮的点击事件
            $(document).keyup(function (event) {
                if (event.keyCode == 13) {
                    $("#btnSubmit").trigger("click");
                }
            });


        });


    </script>
}
<style>
    * {
        margin: 0;
    }

    body {
        height: 100vh;
        overflow: hidden;
        -moz-user-select: none; /*火狐*/
        -webkit-user-select: none; /*webkit浏览器*/
        -ms-user-select: none; /*IE10*/
        -khtml-user-select: none; /*早期浏览器*/
        user-select: none;
    }

    a {
        text-decoration: none;
    }

    .page_Main {
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
    }

    .LoginBox {
        position: absolute;
        left: 50%;
        top: 45%;
        width: 450px;
        transform: translate(-50%,-50%);
    }

    .icon120 {
        text-align: center;
    }

        .icon120 img {
            width: 114px;
            height: auto;
            vertical-align: middle;
        }

    .name120 {
        height: 42px;
        line-height: 42px;
        color: #fff;
        font-size: 28px;
    }

    .iconBox {
        margin-bottom: 20px;
    }

    .loginFormBox {
        position: relative;
        /*height: 340px;*/
        height: 380px;
    }

    .loginFormBgBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 450px;
        height: 100%;
        /*height: 340px;*/
        border-radius: 5px;
        /*background-color: #e1f0f6;*/
        background-color: rgba(225,240,246,.8);
    }

    #LoginForm {
        width: 100%;
        /*height: 100%;
        padding: 50px 50px 0;*/
        height: 320px;
        padding: 25px 50px 0;
        box-sizing: border-box;
    }

    .LoginNameBox, .PassWordBox {
        position: relative;
        width: 100%;
        height: 50px;
        border-radius: 8px;
        /*background-color: #fff;*/
        background-color: rgba(255, 255, 255, 0.7);
    }

    .PassWordBox {
        margin-top: 30px;
    }

    .inputIconBox {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 60px;
        border-right: 1px solid #dfdfdf;
    }

    .InputBox {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 290px;
    }

    .inputIconBox, .InputBox {
        display: inline-block;
    }

    #txt_UserName, #txt_PassWord {
        width: 70%;
        height: 40px;
    }

    .btnSubmitBox {
        /*margin-top: 50px;*/
        margin-top: 40px;
    }

        .btnSubmitBox #btnSubmit {
            display: inline-block;
            width: 100%;
            height: 50px;
            line-height: 50px;
            text-align: center;
            font-size: 22px;
            color: #fff;
            font-weight: 500;
            border-radius: 8px;
            /*border-radius:25px;*/
            background-color: #459be6;
        }

            .btnSubmitBox #btnSubmit:hover {
                background-color: #317ef3;
            }
    /*伪元素清除浮动*/
    .clearfix {
        display: block;
        *zoom: 1;
    }

        .clearfix:after {
            clear: both;
            content: ".";
            display: block;
            height: 0;
            visibility: hidden;
        }

    /*add20200522 plq 添加多方式登录tab start*/
    .SignFlow-tabs {
        height: 60px;
        padding: 0 50px;
        text-align: left;
    }

    .SignFlow-tab {
        display: inline-block;
        color: #444;
        font-size: 16px;
        line-height: 60px;
        height: 60px;
        margin-right: 24px;
        cursor: pointer;
    }

    .SignFlow-tab--active {
        position: relative;
        color: #1a1a1a;
        font-weight: 600;
        font-synthesis: style;
    }

        .SignFlow-tab--active:after {
            display: block;
            position: absolute;
            bottom: 0;
            content: "";
            width: 100%;
            height: 3px;
            background-color: #0084ff;
        }
    /*add20200522 plq 添加多方式登录tab end*/
</style>
<div class="page_Main" style="width: 100%; height: 100vh; background-image: url('@Url.Content("~/Images/LoginIcon/bg.png")');">
    <!--用户登录框-->
    <div class="LoginBox">
        <div class="iconBox">
            <p class="icon120">
                <img src="~/Images/LoginIcon/icon_120.png" alt="120" />
            </p>
            <h4 class="name120">
                云南省院前急救领导台
            </h4>
        </div>
        <div class="loginFormBox">
            <!--输入表单背景框-->
            <div class="loginFormBgBox">
                <!--add20200522 plq 添加多方式登录tab start-->
                <div class="SignFlow-tabs">
                    @*<div class="SignFlow-tab" id="tab_freePswLogin">手机号码登录</div>*@
                    <div class="SignFlow-tab SignFlow-tab--active" id="tab_PswLogin">用户名密码登录</div>
                </div>
                <!--add20200522 plq 添加多方式登录tab end-->
                <form method="post" id="LoginForm">
                    <!--用户名输入行-->
                    <div class="LoginNameBox clearfix">
                        <div class="inputIconBox icon_user">
                            <img src="~/Images/LoginIcon/user.png" alt="用户名" />
                        </div>
                        <div class="InputBox">
                            <input class="easyui-textbox" name="UserName" id="txt_UserName" data-options="required:true,prompt:'工号'" />
                        </div>
                    </div>
                    <!--密码输入行-->
                    <div class="PassWordBox clearfix">
                        <div class="inputIconBox icon_psw">
                            <img src="~/Images/LoginIcon/psw.png" alt="密码" />
                        </div>
                        <div class="InputBox">
                            <input class="easyui-passwordbox" name="PassWord" id="txt_PassWord" data-options="required:true,prompt:'密码'" />
                        </div>
                    </div>
                    <!--登录按钮-->
                    <div class="btnSubmitBox">
                        <a href="javascript:void(0)" id="btnSubmit">登录</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<style>
    .BtnRegisterBox {
        position: relative;
        margin-top: 12px;
        height: 20px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
        background-color: transparent;
    }

    .Button {
        display: inline-block;
        padding: 0 16px;
        font-size: 14px;
        line-height: 32px;
        color: #2e82ff;
        text-align: center;
        cursor: pointer;
        background: none;
        border: 1px solid;
        border-radius: 3px;
    }

        .Button:focus {
            outline: none;
            -webkit-transition: -webkit-box-shadow .3s;
            transition: -webkit-box-shadow .3s;
            transition: box-shadow .3s;
            transition: box-shadow .3s,-webkit-box-shadow .3s;
        }

    .Button--plain {
        height: auto;
        padding: 0;
        line-height: inherit;
        background-color: transparent;
        border: none;
        border-radius: 0;
    }

        .Button--plain:hover {
            /*color: #76839b;*/
            opacity: .6;
        }

    .SignFlow-btnBox {
        position: absolute;
        top: 50%;
        left: 0;
        padding: 4px 0;
        color: #767676;
        font-size: 14px;
        -webkit-transform: translateY(-50%);
        transform: translateY(-50%);
    }
</style>
